all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
state_sponsor + public_service + social_service + drugtk |
duration,
data = dt, dist = "negbin"))
summary(z4 <- zeroinfl(claimed ~
fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
state_sponsor + public_service + social_service + drugtk |
fate_leader_dummy,
data = dt, dist = "negbin"))
stargazer(z1, z2, z3, z4,
type = "text",
order = c("duration", "splinterhist", "civi1", "duration*splinterhist", "duration:civi1",
"fate_leader_dummyDecapitation", "fate_leader_dummy_lag1Decapitation", "fate_leader_dummy_lag2Decapitation", "fate_leader_dummy_lag3Decapitation",
"all_log", "nonterr_casualties_log", "diversity", "shr_trans", "rel1", "state_sponsor", "public_service", "social_service", "drugtk"),
covariate.labels = c("Group duration (in years)",
"Duration*Splinter group",
"Duration*Civilian targets",
"Splinter group",
"Civilian targets",
"Decapitation",
"Decapitation (L1)",
"Decapitation (L2)",
"Decapitation (L3)",
"Total number of attacks",
"Number of non-militant casualties",
"Attack diversity",
"Share of transnational attacks",
"Religious fundamentalist group",
"State sponsorship",
"Public service provision",
"Social service provision",
"Drug-trafficking",
"Constant"),
column.labels = c("Duration", "Splinter", "Target", "Decapitation", "Duration", "Splinter", "Target", "Decapitation"),
model.numbers = T)
summary(s1 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi +
EAP + ECA + LAC + MENA + SAS + SSA,
data = dt))
summary(s2 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration*splinterhist+
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
EAP + ECA + LAC + MENA + SAS + SSA,
data = dt))
summary(s3 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
EAP + ECA + LAC + MENA + SAS + SSA,
data = dt))
summary(s4 <- selection(stage1 ~ mul_bases +
fate_leader_dummy,
stage2 ~ fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
EAP + ECA + LAC + MENA + SAS + SSA,
data = dt))
stargazer(s1, s2, s3, s4,
type = "text",
order = c("duration", "splinterhist", "civi1", "duration*splinterhist", "duration:civi1",
"fate_leader_dummyDecapitation", "fate_leader_dummy_lag1Decapitation", "fate_leader_dummy_lag2Decapitation", "fate_leader_dummy_lag3Decapitation",
"all_log", "nonterr_casualties_log", "diversity", "shr_trans", "rel1", "EAP", "ECA", "LAC", "MENA", "SAS", "SSA"),
covariate.labels = c("Group duration (in years)",
"Duration*Splinter group",
"Duration*Civilian targets",
"Splinter group",
"Civilian targets",
"Decapitation",
"Decapitation (L1)",
"Decapitation (L2)",
"Decapitation (L3)",
"Total number of attacks",
"Number of non-militant casualties",
"Attack diversity",
"Share of transnational attacks",
"Religious fundamentalist group",
"East Asia and Pacific",
"Europe and Central Asia",
"Latin America and Caribbean",
"Middle East and North Africa",
"South Asia",
"Sub-Saharan Africa",
"Constant"),
column.labels = c("Duration", "Splinter", "Target", "Decapitation", "Duration", "Splinter", "Target", "Decapitation"),
model.numbers = T)
summary(z1 <- zeroinfl(claimed ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi +
EAP + ECA + LAC + MENA + SAS + SSA |
duration,
data = dt, dist = "negbin"))
summary(z2 <- zeroinfl(claimed ~
duration*splinterhist +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
EAP + ECA + LAC + MENA + SAS + SSA |
duration,
data = dt, dist = "negbin"))
summary(z3 <- zeroinfl(claimed ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
EAP + ECA + LAC + MENA + SAS + SSA |
duration,
data = dt, dist = "negbin"))
summary(z4 <- zeroinfl(claimed ~
fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
EAP + ECA + LAC + MENA + SAS + SSA |
fate_leader_dummy,
data = dt, dist = "negbin"))
stargazer(z1, z2, z3, z4,
type = "text",
order = c("duration", "splinterhist", "civi1", "duration*splinterhist", "duration:civi1",
"fate_leader_dummyDecapitation", "fate_leader_dummy_lag1Decapitation", "fate_leader_dummy_lag2Decapitation", "fate_leader_dummy_lag3Decapitation",
"all_log", "nonterr_casualties_log", "diversity", "shr_trans", "rel1", "EAP", "ECA", "LAC", "MENA", "SAS", "SSA"),
covariate.labels = c("Group duration (in years)",
"Duration*Splinter group",
"Duration*Civilian targets",
"Splinter group",
"Civilian targets",
"Decapitation",
"Decapitation (L1)",
"Decapitation (L2)",
"Decapitation (L3)",
"Total number of attacks",
"Number of non-militant casualties",
"Attack diversity",
"Share of transnational attacks",
"Religious fundamentalist group",
"East Asia and Pacific",
"Europe and Central Asia",
"Latin America and Caribbean",
"Middle East and North Africa",
"South Asia",
"Sub-Saharan Africa",
"Constant"),
column.labels = c("Duration", "Splinter", "Target", "Decapitation", "Duration", "Splinter", "Target", "Decapitation"),
model.numbers = T)
dt$stage1 = ifelse(dt$all > 0, 1, 0)
dt$stage2 = ifelse(dt$claimedratio == 1, 1, 0)
summary(s1 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi,
data = subset(dt, suic == 1)))
summary(s2 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration*splinterhist +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel,
data = subset(dt, suic == 1)))
summary(s3 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel,
data = subset(dt, suic == 1)))
summary(s4 <- selection(stage1 ~ mul_bases +
fate_leader_dummy,
stage2 ~ fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel,
data = subset(dt, suic == 1)))
summary(s5 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi +
lead_hierarch + rivaldum,
data = subset(dt, suic == 1)))
summary(s6 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration*splinterhist +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
lead_hierarch + rivaldum,
data = subset(dt, suic == 1)))
summary(s7 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
lead_hierarch + rivaldum,
data = subset(dt, suic == 1)))
summary(s8 <- selection(stage1 ~ mul_bases +
fate_leader_dummy,
stage2 ~ fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
lead_hierarch + rivaldum,
data = subset(dt, suic == 1)))
stargazer(s1, s2, s3, s4, s5, s6, s7, s8, type = "text",
order = c("duration", "splinterhist", "civi1", "duration*splinterhist", "duration:civi1",
"fate_leader_dummyDecapitation", "fate_leader_dummy_lag1Decapitation", "fate_leader_dummy_lag2Decapitation", "fate_leader_dummy_lag3Decapitation",
"all_log", "nonterr_casualties_log", "diversity", "shr_trans", "rel1", "lead_hierarch1", "rivaldum"),
covariate.labels = c("Group duration (in years)",
"Duration*Splinter group",
"Duration*Civilian targets",
"Splinter group",
"Civilian targets",
"Decapitation",
"Decapitation (L1)",
"Decapitation (L2)",
"Decapitation (L3)",
"Total number of attacks",
"Number of non-militant casualties",
"Attack diversity",
"Share of transnational attacks",
"Religious fundamentalist group",
"Hierarchical leadership",
"Rival groups",
"Constant"),
column.labels = c("Duration", "Splinter", "Target", "Decapitation", "Duration", "Splinter", "Target", "Decapitation"),
model.numbers = T)
summary(z1 <- zeroinfl(claimed ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi |
duration,
data = subset(dt, suic == 1), dist = "negbin"))
summary(z2 <- zeroinfl(claimed ~
duration*splinterhist +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel |
duration,
data = subset(dt, suic == 1), dist = "negbin"))
summary(z3 <- zeroinfl(claimed ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel |
duration,
data = subset(dt, suic == 1), dist = "negbin"))
summary(z4 <- zeroinfl(claimed ~
fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel |
fate_leader_dummy,
data = subset(dt, suic == 1), dist = "negbin"))
summary(z5 <- zeroinfl(claimed ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi +
lead_hierarch + rivaldum |
duration,
data = subset(dt, suic == 1), dist = "negbin"))
summary(z6 <- zeroinfl(claimed ~
duration*splinterhist +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
lead_hierarch + rivaldum |
duration,
data = subset(dt, suic == 1), dist = "negbin"))
summary(z7 <- zeroinfl(claimed ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
lead_hierarch + rivaldum |
duration,
data = subset(dt, suic == 1), dist = "negbin"))
summary(z8 <- zeroinfl(claimed ~
fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
lead_hierarch + rivaldum |
fate_leader_dummy,
data = subset(dt, suic == 1), dist = "negbin"))
stargazer(z1, z2, z3, z4, z5, z6, z7, z8, type = "text",
order = c("duration", "splinterhist", "civi1", "duration*splinterhist", "duration:civi1",
"fate_leader_dummyDecapitation", "fate_leader_dummy_lag1Decapitation", "fate_leader_dummy_lag2Decapitation", "fate_leader_dummy_lag3Decapitation",
"all_log", "nonterr_casualties_log", "diversity", "shr_trans", "rel1", "lead_hierarch1", "rivaldum"),
covariate.labels = c("Group duration (in years)",
"Duration*Splinter group",
"Duration*Civilian targets",
"Splinter group",
"Civilian targets",
"Decapitation",
"Decapitation (L1)",
"Decapitation (L2)",
"Decapitation (L3)",
"Total number of attacks",
"Number of non-militant casualties",
"Attack diversity",
"Share of transnational attacks",
"Religious fundamentalist group",
"Hierarchical leadership",
"Rival groups",
"Constant"),
column.labels = c("Duration", "Splinter", "Target", "Decapitation", "Duration", "Splinter", "Target", "Decapitation"),
model.numbers = T)
last_row <- dt %>% # select the last row for each group, last row indicates the maximum group duration
group_by(gname) %>%
slice(n())
last_row = last_row[c("gname", "duration")] # only keep the group name and duration variables
colnames(last_row)[2] <- "lifespan" # change column names
summary(last_row$lifespan)
dt = merge(dt, last_row, by = "gname", all.x = T) # merge maximum group duration data with the main dataframe
dt$short = ifelse(dt$lifespan > 23.5, 0, 1) # create a dummy variable for groups with short lifespans
dt$stage1 = ifelse(dt$all > 0, 1, 0)
dt$stage2 = ifelse(dt$claimedratio == 1, 1, 0)
summary(s1 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi,
data = subset(dt, short == 1)))
summary(s2 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration*splinterhist +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel,
data = subset(dt, short == 1)))
summary(s3 <- selection(stage1 ~ mul_bases +
duration,
stage2 ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel,
data = subset(dt, short == 1)))
summary(s4 <- selection(stage1 ~ mul_bases +
fate_leader_dummy,
stage2 ~ fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel,
data = subset(dt, short == 1)))
stargazer(s1, s2, s3, s4,
type = "text",
order = c("duration", "splinterhist", "civi1", "duration*splinterhist", "duration:civi1",
"fate_leader_dummyDecapitation", "fate_leader_dummy_lag1Decapitation", "fate_leader_dummy_lag2Decapitation", "fate_leader_dummy_lag3Decapitation",
"all_log", "nonterr_casualties_log", "diversity", "shr_trans", "rel1", "lead_hierarch1", "rivaldum"),
covariate.labels = c("Group duration (in years)",
"Duration*Splinter group",
"Duration*Civilian targets",
"Splinter group",
"Civilian targets",
"Decapitation",
"Decapitation (L1)",
"Decapitation (L2)",
"Decapitation (L3)",
"Total number of attacks",
"Number of non-militant casualties",
"Attack diversity",
"Share of transnational attacks",
"Religious fundamentalist group",
"Constant"),
column.labels = c("Duration", "Splinter", "Target", "Decapitation", "Duration", "Splinter", "Target", "Decapitation"),
model.numbers = T)
summary(z1 <- zeroinfl(claimed ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi |
duration,
data = subset(dt, short == 1), dist = "negbin"))
summary(z2 <- zeroinfl(claimed ~
duration*splinterhist +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel |
duration,
data = subset(dt, short == 1), dist = "negbin"))
summary(z3 <- zeroinfl(claimed ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel |
duration,
data = subset(dt, short == 1), dist = "negbin"))
summary(z4 <- zeroinfl(claimed ~
fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel |
fate_leader_dummy,
data = subset(dt, short == 1), dist = "negbin"))
stargazer(z1, z2, z3, z4,
type = "text",
order = c("duration", "splinterhist", "civi1", "duration*splinterhist", "duration:civi1",
"fate_leader_dummyDecapitation", "fate_leader_dummy_lag1Decapitation", "fate_leader_dummy_lag2Decapitation", "fate_leader_dummy_lag3Decapitation",
"all_log", "nonterr_casualties_log", "diversity", "shr_trans", "rel1", "lead_hierarch1", "rivaldum"),
covariate.labels = c("Group duration (in years)",
"Duration*Splinter group",
"Duration*Civilian targets",
"Splinter group",
"Civilian targets",
"Decapitation",
"Decapitation (L1)",
"Decapitation (L2)",
"Decapitation (L3)",
"Total number of attacks",
"Number of non-militant casualties",
"Attack diversity",
"Share of transnational attacks",
"Religious fundamentalist group",
"Constant"),
column.labels = c("Duration", "Splinter", "Target", "Decapitation", "Duration", "Splinter", "Target", "Decapitation"),
model.numbers = T)
summary(z1 <- zeroinfl(unclaimed ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi |
duration,
data = dt, dist = "negbin"))
summary(z2 <- zeroinfl(unclaimed ~
duration*splinterhist +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel |
duration,
data = dt, dist = "negbin"))
summary(z3 <- zeroinfl(unclaimed ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel |
duration,
data = dt, dist = "negbin"))
summary(z4 <- zeroinfl(unclaimed ~
fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel |
fate_leader_dummy,
data = dt, dist = "negbin"))
summary(z5 <- zeroinfl(unclaimed ~
duration +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
splinterhist + civi +
lead_hierarch + rivaldum |
duration,
data = dt, dist = "negbin"))
summary(z6 <- zeroinfl(unclaimed ~
duration*splinterhist +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
lead_hierarch + rivaldum |
duration,
data = dt, dist = "negbin"))
summary(z7 <- zeroinfl(unclaimed ~
duration*civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
lead_hierarch + rivaldum |
duration,
data = dt, dist = "negbin"))
summary(z8 <- zeroinfl(unclaimed ~
fate_leader_dummy + fate_leader_dummy_lag1 + fate_leader_dummy_lag2 + fate_leader_dummy_lag3 +
splinterhist + civi +
all_log +
nonterr_casualties_log + diversity + shr_trans + rel +
lead_hierarch + rivaldum |
fate_leader_dummy,
data = dt, dist = "negbin"))
stargazer(z1, z2, z3, z4, z5, z6, z7, z8, type = "text",
order = c("duration", "splinterhist", "civi1", "duration*splinterhist", "duration:civi1",
"fate_leader_dummyDecapitation", "fate_leader_dummy_lag1Decapitation", "fate_leader_dummy_lag2Decapitation", "fate_leader_dummy_lag3Decapitation",
"all_log", "nonterr_casualties_log", "diversity", "shr_trans", "rel1", "lead_hierarch1", "rivaldum"),
covariate.labels = c("Group duration (in years)",
"Duration*Splinter group",
"Duration*Civilian targets",
"Splinter group",
"Civilian targets",
"Decapitation",
"Decapitation (L1)",
"Decapitation (L2)",
"Decapitation (L3)",
"Total number of attacks",
"Number of non-militant casualties",
"Attack diversity",
"Share of transnational attacks",
"Religious fundamentalist group",
"Hierarchical leadership",
"Rival groups",
"Constant"),
column.labels = c("Duration", "Splinter", "Target", "Decapitation", "Duration", "Splinter", "Target", "Decapitation"),
model.numbers = T)
